package net.gaox.designs.behaviors.strategys.config;

import net.gaox.designs.behaviors.strategys.service.MessageService;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>  </p>
 *
 * @author gaox·Eric
 * @date 2020/2/25 14:56
 */
@Component
public class MessageServiceContext {

    private final Map<Integer, MessageService> handlerMap = new HashMap<>(16);

    public MessageService getMessageService(Integer type) {
        return handlerMap.get(type);
    }

    public void putMessageService(Integer code, MessageService messageService) {
        handlerMap.put(code, messageService);
    }
}